package demo01;

//动物类的测试类
public class AnimalTest {
    public static void main(String[] args) {
        //需求: 测试猫类
        //空参
        Cat cat = new Cat();
        cat.setName("哆啦B梦");
        cat.setAge(12);
        cat.eat();
        cat.jump();
        //全参
        Cat cat2 = new Cat("哆啦C梦", 18);
        cat2.jump();
        cat2.eat();
        //接口多态
        Jumpping j1 = new Cat();
        Jumpping j2 = new Cat("哆啦A梦", 15);

        System.out.println("-----------------------------------------------");
        //需求: 测试狗类.
        //空参
        Dog dog = new Dog();
        dog.setName("xdog");
        dog.setAge(15);
        dog.eat();
        //全参
        Dog dog1 = new Dog("cdog", 17);
        dog1.eat();
    }
}
